package com.loveprogrammer.model.battle;

import com.loveprogrammer.engine.findmonster.DefaultFindMonsters;
import com.loveprogrammer.engine.findmonster.FindMonstersEngine;
import com.loveprogrammer.factory.MapFactory;
import com.loveprogrammer.factory.template.MapTemplate;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * @ClassName TownMap
 * @Description 城镇地图
 * @Author admin
 * @Date 2024/2/22 9:58
 * @Version 1.0
 */
@Data
public class TownMap implements Serializable {

    private String id;

    private FindMonstersEngine findMonsterEngine;

    // 级别 1 就是 0-9级  9 就是 90-99级
    private int level;

    private int floorId;

    private String name;

    private String desc;

    private String teamSize;

    // 可能出现的野怪
    private List<MonsterInMap> monsters;

    public TownMap(MapTemplate mapTemplate) {
        this.findMonsterEngine = new DefaultFindMonsters();
        this.name = mapTemplate.getName();
        this.level = mapTemplate.getLevel();
        this.monsters = MapFactory.createMonsters(mapTemplate);
        this.desc = mapTemplate.getDesc();
        this.teamSize = mapTemplate.getTeamSize();
        this.id = mapTemplate.getId();
    }
}
